package com.wwy.user.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.wwy.mybatis.BaseMapperX;
import com.wwy.user.module.entity.User;
import com.wwy.user.module.vo.user.UserLogin;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;


/**
 * 用户表Mapper
 *
 * @author wwy
 */
@Mapper
public interface UserMapper extends BaseMapperX<User> {

    default List<User> selectList(UserLogin userLogin) {
     return selectList(new LambdaQueryWrapper<User>()
             .eq(StringUtils.isNotBlank(userLogin.getUsername()), User::getUsername, userLogin.getUsername()));
    }

}
